-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DAG Docs to Trigger UI #13365
Add DAG Docs to Trigger UI #13365
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Thanks @jyotidhiman0610!
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
@ryanahamilton how can I merge this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appears to be a related error in there:
=================================== FAILURES ===================================
________________ TestTriggerDag.test_trigger_dag_params_conf_1 _________________
a = (<tests.www.test_views.TestTriggerDag testMethod=test_trigger_dag_params_conf_1>,)
@wraps(func)
def standalone_func(*a):
> return func(*(a + p.args), **p.kwargs)
/usr/local/lib/python3.6/site-packages/parameterized/parameterized.py:530:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/www/test_views.py:2791: in test_trigger_dag_params_conf
resp = self.client.get(f'trigger?dag_id={test_dag_id}&conf={test_request_conf}')
/usr/local/lib/python3.6/site-packages/werkzeug/test.py:1006: in get
return self.open(*args, **kw)
/usr/local/lib/python3.6/site-packages/flask/testing.py:227: in open
follow_redirects=follow_redirects,
/usr/local/lib/python3.6/site-packages/werkzeug/test.py:970: in open
response = self.run_wsgi_app(environ.copy(), buffered=buffered)
/usr/local/lib/python3.6/site-packages/werkzeug/test.py:861: in run_wsgi_app
rv = run_wsgi_app(self.application, environ, buffered=buffered)
/usr/local/lib/python3.6/site-packages/werkzeug/test.py:1096: in run_wsgi_app
app_rv = app(environ, start_response)
/usr/local/lib/python3.6/site-packages/flask/app.py:2464: in __call__
return self.wsgi_app(environ, start_response)
/usr/local/lib/python3.6/site-packages/flask/app.py:2450: in wsgi_app
response = self.handle_exception(e)
/usr/local/lib/python3.6/site-packages/flask/app.py:1867: in handle_exception
reraise(exc_type, exc_value, tb)
/usr/local/lib/python3.6/site-packages/flask/_compat.py:39: in reraise
raise value
/usr/local/lib/python3.6/site-packages/flask/app.py:2447: in wsgi_app
response = self.full_dispatch_request()
/usr/local/lib/python3.6/site-packages/flask/app.py:1952: in full_dispatch_request
rv = self.handle_user_exception(e)
/usr/local/lib/python3.6/site-packages/flask/app.py:1821: in handle_user_exception
reraise(exc_type, exc_value, tb)
/usr/local/lib/python3.6/site-packages/flask/_compat.py:39: in reraise
raise value
/usr/local/lib/python3.6/site-packages/flask/app.py:1950: in full_dispatch_request
rv = self.dispatch_request()
/usr/local/lib/python3.6/site-packages/flask/app.py:1936: in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
airflow/www/auth.py:34: in decorated
return func(*args, **kwargs)
airflow/www/decorators.py:60: in wrapper
return f(*args, **kwargs)
airflow/utils/session.py:65: in wrapper
return func(*args, session=session, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <airflow.www.views.Airflow object at 0x7fb436cab6d8>
session = <sqlalchemy.orm.session.Session object at 0x7fb43604c2b0>
@expose('/trigger', methods=['POST', 'GET'])
@auth.has_access(
[
(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG),
(permissions.ACTION_CAN_CREATE, permissions.RESOURCE_DAG_RUN),
]
)
@action_logging
@provide_session
def trigger(self, session=None):
"""Triggers DAG Run."""
dag_id = request.values.get('dag_id')
origin = get_safe_url(request.values.get('origin'))
request_conf = request.values.get('conf')
if request.method == 'GET':
# Populate conf textarea with conf requests parameter, or dag.params
default_conf = ''
if request_conf:
default_conf = request_conf
else:
try:
dag = current_app.dag_bag.get_dag(dag_id)
doc_md = wwwutils.wrapped_markdown(getattr(dag, 'doc_md', None))
default_conf = json.dumps(dag.params, indent=4)
except TypeError:
flash("Could not pre-populate conf field due to non-JSON-serializable data-types")
return self.render_template(
> 'airflow/trigger.html', dag_id=dag_id, origin=origin, conf=default_conf, doc_md=doc_md
)
E UnboundLocalError: local variable 'doc_md' referenced before assignment
airflow/www/views.py:1423: UnboundLocalError
@ryanahamilton Thank you so much for pointing out the test case, I have done the necessary changes & all the tests have passed. |
Awesome work, congrats on your first merged pull request! |
closes #12550